#include "mainthread.h"
#include"qdebug.h"

mainTHread::mainTHread()
{
otherthread =new otherQThread(this);
otherthread->b=NULL;

connect(otherthread,SIGNAL(sigDone()),this,SLOT(returndone()));
getcode=0;
a();
qDebug()<<getcode<<"\n";

}

void mainTHread::a()
{

    qDebug()<<"this"<<"\n";
    otherthread->start();
    while(otherthread->b==0)
    {
        //qDebug()<<"一直运行的while:"<<getcode<<"\n";
    }

qDebug()<<"完成了子进程 子进程里面的值为:"<<otherthread->b<<"\n";
}
void mainTHread::returndone()
{   qDebug()<<"返回了"<<"\n";
    getcode=10;
}
